<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>��ҳ</title>
<link href="<?php echo $this->_webroot('/style/jq-ui/jquery-ui-1.8.18.custom.css'); ?>" rel="stylesheet" type="text/css">
<link href="<?php echo $this->_webroot('/style/css.css'); ?>" rel="stylesheet" type="text/css">
<link href="<?php echo $this->_webroot('/style/content.css'); ?>" rel="stylesheet" type="text/css">

<script language="JavaScript">
<!--
function changImg(id){
document.getElementById(id).src ='<?php echo $this->_url('user/kcaptcha') .'?'; ?>'+Math.random(1);
}
//-->
</script>
<script type="text/javascript" src="<?php echo $this->_webroot('/script/jquery-1.7.1.min.js'); ?>"></script>
<script type="text/javascript" src="<?php echo $this->_webroot('/script/jquery-ui-1.8.18.custom.min.js'); ?>"></script>
<script type="text/javascript" src="<?php echo $this->_webroot('/script/jquery.carouFredSel-5.5.0-packed.js'); ?>"></script>
<script type="text/javascript" src="<?php echo $this->_webroot('/script/js.js'); ?>"></script>
<script type="text/javascript" src="<?php echo $this->_webroot('script/content.js'); ?>"></script>
</head>
<body>
<psp:tags     htmlname='divstart'  iconname='divstart' />
<psp:tags     htmlname='default_topnav'  iconname='defaulttopnav' />
<div class="head">
    <psp:tags     htmlname='default_index_logobox'  iconname='default_index_logobox' />
	
 <?php
    $cityid = $this->controller->C_session->read('_user_city_id');
	$cityname = 'ȫ��';
	if($cityid) {
        $this->controller->loadModel('area');
	    $array = $this->controller->area->find('first', array('conditions' =>array('area.id' =>$cityid )));
		if($array) {
		    $cityname = $array['area']['area_name'];
		}	    
	}	
?>    
    <div class="exchangeArea">
    	<a href="#">��<span class="fontRed"><?php echo $cityname; ?></span>��<br /><span class="divcityqiehuang fontDust" rel="<?php echo $this->_url('default/city/');?>">��������</span></a>		
    </div>	
	
<div id="div_city_qiehuang" style="display:none;left: 10px;position: relative;top: 50px;z-index: 1005;background-color: #666;padding: 10px;">
    <div  class="div_city_qiehuangClose"  style="cursor: pointer;position: absolute;right: 20px;top: 10px;"><img src="<?php echo $this->_webroot('images/loginDialogClose.jpg'); ?>"  /></div>
    <iframe  id="div_city_qiehuang1" width="965" height="786" style="border:1px solid #ccc;"></iframe>
</div>
<script>
jQuery(function($){
$(".divcityqiehuang").click(function(){
	var url = $(this).attr("rel");
	$("#div_city_qiehuang1").attr("src",url);	
	$("#div_city_qiehuang").dialog({width:1000,height:860,modal: true});
})
$(".div_city_qiehuangClose").click(function(){
    $("#div_city_qiehuang").dialog( "close" );
})
   }
)
</script>	
	
<script language="JavaScript">	
jQuery(function($){
$('.selecttype').click( function() {
  $('#searchkeyForm').attr('action',$(this).attr('href'));
});	
});
</script> 
    <div class="search-box">
    	<div class="switch-nav-box">
            <ul class="switch-nav">
                <li class="on"><div class="switch-nav-item"><div class="switch-nav-left"><div class="switch-nav-right"><a href="<?php echo $this->_url('default/productlist/');?>" class="selecttype" >��Ʒ</a></div></div></div></li>
                <li><div class="switch-nav-item"><div class="switch-nav-left"><div class="switch-nav-right"><a href="<?php echo $this->_url('default/productlist/brand/');?>"  class="selecttype" >Ʒ��</a></div></div></div></li>
                <li><div class="switch-nav-item"><div class="switch-nav-left"><div class="switch-nav-right"><a href="<?php echo $this->_url('default/shop/');?>" class="selecttype" >�̼�</a></div></div></div></li>
            </ul>
            <div class="clear"></div>
        </div>
        <div class="search-w-bg">
        	<div class="searchForm">
            	<form action="<?php echo $this->_url('default/productlist/');?>" method="get" id="searchkeyForm" class="searchkeyForm" name="searchkeyForm" >
            	<input type="text" class="searchInput" name="k"  />
                <input type="submit" class="searchBtn" value="���ѻ�"  />
                </form>
            </div>
            <div class="adsearch">
            	<a href="<?php echo $this->_url('default/productlist/');?>">�߼�����</a><br />
                <a href="<?php echo $this->_url('article/index/?id=3');?>">ʹ�ð���</a>
            </div>
            <div class="clear"></div>
        </div>
		<psp:tags     htmlname='default_index_searchworld'  iconname='default_index_searchworld' />

    </div>
    <div class="clear"></div>
</div>

<psp:tags     htmlname='default_navlist'  iconname='default_navlist' />

<div class="container">
	<div class="mod1">
    	<div class="leftMenuBox">
        	<ul class="leftMenu">
		    <?php 
			$this->controller->loadModel('brandgoodscategories');
			$this->controller->loadModel('brand');			
			?>
            <?php $i=0;  foreach(array_slice ($CATEGORY[0], 0) as $key=>$cat){ $i++; ?>				
            	<li class="<?php if ($i==1) { ?>first <?php } ?>leftMenuLi">
                	<div class="item">
                        <a href="#" class="leftMenuItem">
                            <div class="leftMenuLeft"><?php echo  $cat['cat_name'];?></div><div class="leftMenuRight"><?php echo  $cat['content'];?></div>
                        </a>
                        <b class="pointer"></b>
                    </div>
                    <div class="leftMenuCat">
                    	<div class="catLeft">
                        	<div class="catItem">
                            	<h3><a href="<?php echo $this->_url('default/productlist1/');?>?id=<?php echo  $cat['id'];?>&k=<?php echo  $k;?>" title="<?php echo  $cat['cat_name'];?>"><?php echo  $cat['cat_name'];?></a></h3>
			                    <?php if(isset($CATEGORY[$cat['id']]) && $CATEGORY[$cat['id']]){?>
				                    <?php  foreach(array_slice ($CATEGORY[$cat['id']], 0) as $subcat){?> 
				                        <a href="<?php echo $this->_url('default/productlist1/');?>?id=<?php echo  $subcat['id'];?>&k=<?php echo  $k;?>" title="<?php echo  $cat['cat_name'];?>"><?php echo  $subcat['cat_name'];?></a> 
					                <?php }?>
				                <?php }?> 
                            </div>
                        </div>
                        <?php 
						$brandgoodscategories = $this->controller->brandgoodscategories->find('all', array('conditions' => array('brandgoodscategories.category_id' => $cat['id'])));
						$brand_ids_array = array();
						$brands_array = array();
						foreach($brandgoodscategories as $val) {
						    $brand_ids_array[$val['brandgoodscategories']['brand_id']] = $val['brandgoodscategories']['brand_id'];
						}						
						if(!empty($brand_ids_array)) {
						    $brands_array = $this->controller->brand->find('all', array('conditions' => array('brand.id' => $brand_ids_array),'limit'=>20));						
						}
						?>						
                        <div class="catRight">
                        	<div class="catItem">
                            	<h3><a href="#">���Ʒ��</a></h3>
								<?php foreach($brands_array as $val) { $val=$val['brand'];?>
                                <a href="<?php echo $this->_url('default/productlist1/');?>?id=<?php echo  $cat['id'];?>&k=<?php echo  $k;?>&brand_id=<?php echo  $val['id'];?>"><?php echo  $val['brand_name'];?></a>
								<?php } ?>
                            </div>
                        </div>
                    </div>
                </li>
            <?php }?>	

                <li class="last"><a href="<?php echo $this->_url('default/productlist/');?>" class="more">������Ʒ>></a></li>
            </ul>
            <div class="clear"></div>
        </div>
        
        <div class="scroll-boxs">		
		    <psp:tags     htmlname='default_index_slide'  iconname='default_index_slide' />
		    <psp:tags     htmlname='default_index_scroll'  iconname='default_index_scroll' />
        </div>
        
        <div class="sidebar">
		    <psp:tags     htmlname='default_index_loginbox'  iconname='default_index_loginbox' /> 
			
            <div class="trends">
            	<div class="hd">
                	<div class="left"><psp:tags labels='���¶�̬' iconname='defaultindex_lang_zuixing' /></div><div class="right"><a href="#">+����</a></div>
                </div>
                <psp:tags     htmlname='default_index_news'  iconname='defaultindex_news' />
            </div>
        </div>
    </div>
	
    <psp:tags     htmlname='default_index_ad1'  iconname='defaultindex_ad1' />
    
	
    <div class="mod2">
    	<div class="category-box">
        	<div class="category-hd">
            	<div class="category-tab">
                	<ul class="mian-category-tab">
                    	<li class="selected"><div class="left-bg"><div class="right-bg">������ҵ</div></div></li>
                        <li><div class="left-bg"><div class="right-bg">ͬ��֪����Ȧ</div></div></li>
                    </ul>
                </div>
                <div class="select-area">
                	<select name="">
                    	<option value="0">ѡ�����</option>
                    </select>
                </div>
            </div>
            
            <psp:tags     htmlname='default_index_shopcat'  iconname='default_index_shopcat' />
            <psp:tags     htmlname='default_index_citycat'  iconname='default_index_citycat' />            

            <div class="clear"></div>
        </div>
        

        
        <div class="sidebar">
            <div class="guide-box">
            	<div class="hd2">
                	<ul class="guide-box-tab">
                    	<li class="selected"><div class="guide-left-bg"><div class="guide-right-bg">������·</div></div></li>
                        <li><div class="guide-left-bg"><div class="guide-right-bg">�۸�����</div></div></li>
                        <li><div class="guide-left-bg"><div class="guide-right-bg">��������</div></div></li>
                    </ul>
                </div>
                
                <psp:tags     htmlname='default_index_guide1'  iconname='default_index_guide1' /> 
                <psp:tags     htmlname='default_index_guide2'  iconname='default_index_guide2' />                 
                <psp:tags     htmlname='default_index_guide3'  iconname='default_index_guide3' />
                
                <div class="clear"></div>
            </div>
            <psp:tags     htmlname='default_index_activity'  iconname='default_index_activity' />			

        </div>
        <div class="clear"></div>
    </div>    
    <psp:tags     htmlname='default_index_ad2'  iconname='default_index_ad2' />
    
    <psp:tags     htmlname='default_index_mod1'  iconname='default_index_mod1' />
    <psp:tags     htmlname='default_index_mod2'  iconname='default_index_mod2' /> 
	
</div>
<psp:tags     htmlname='default_footer'  iconname='defaultfooter' />

</body>
</html>